<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/

Route::any('/', 'WechatController@serve');
Route::get('index', 'Backend\IndexController@index');


Route::any('/wx/test', 'WebController@setWechatMenu');
Route::any('/wx/test1', 'WebController@test1');

Route::any('/test', 'WebController@test');
Route::any('/wx/authorizes', 'WebController@authorizes');
Route::get('/wx/login', 'WebController@login');
Route::post('/wx/login', 'WebController@doLogin');
Route::get('/wx/getcode', 'WebController@getcode');
Route::get('/wx/logout', 'WebController@logout');

Route::any('/wx/index', 'WebController@index');

Route::any('/wx/game', 'WebController@game');
Route::any('/wx/activity', 'WebController@activity');
Route::any('/wx/activityinfo', 'WebController@activityinfo');

Route::get('/wx/commentindex', 'WebController@commentindex');
Route::get('/wx/comment', 'WebController@comment');
Route::post('/wx/comment', 'WebController@docomment');

Route::get('/wx/transfer', 'WebController@transfer');
Route::post('/wx/dotransfer', 'WebController@dotransfer');

Route::any('/wx/barList', 'WebController@barList');
Route::any('/wx/barInfo', 'WebController@barInfo');

Route::any('/wx/shop', 'WebController@shop');
Route::any('/wx/doshop', 'WebController@doshop');

Route::any('/wx/myshop', 'WebController@myshop');
Route::any('/wx/gshop', 'WebController@gshop');

Route::get('/wx/recharge', 'WebController@recharge');
Route::post('/wx/recharge', 'WebController@dorecharge');
Route::any('/wx/notify', 'WebController@notify');
//Route::any('/wxtest/recharge', 'WebController@recharge');

Route::get('/backend/login', 'Backend\LoginController@index');
Route::post('/backend/login', 'Backend\LoginController@doLogin');

Route::group(['prefix'=>'backend','middleware'=>'admin'],function() {
    //登陆
    Route::get('logout', 'Backend\LoginController@logout');
    //首页
    Route::get('index', 'Backend\IndexController@index');
    //主页管理
    Route::get('homemanage', 'Backend\IndexController@homemanage');
    Route::post('homemanage', 'Backend\IndexController@posthomemanage');


    //商城管理
    Route::get('shop', 'Backend\ShopController@index');
    Route::get('addshop', 'Backend\ShopController@create');
    Route::get('editshop', 'Backend\ShopController@edit');
    Route::post('update', 'Backend\ShopController@update');
    Route::post('shopstore', 'Backend\ShopController@store');
    Route::get('delshop', 'Backend\ShopController@destroy');

    //游戏管理
    Route::get('gamemanage', 'Backend\IndexController@gamemanage');
    Route::get('addgamemanage', 'Backend\IndexController@addgamemanage');
    Route::post('addgamemanage', 'Backend\IndexController@doaddgamemanage');
    Route::get('editgamemanage', 'Backend\IndexController@editgamemanage');
    Route::post('editgamemanage', 'Backend\IndexController@doeditgamemanage');
    Route::get('delgamemanage', 'Backend\IndexController@delgamemanage');


    //会员天地
    Route::get('activity', 'Backend\IndexController@activity');
    Route::get('addactivity', 'Backend\IndexController@addactivity');
    Route::post('addactivity', 'Backend\IndexController@postaddactivity');
    Route::get('editactivity', 'Backend\IndexController@editactivity');
    Route::post('editactivity', 'Backend\IndexController@posteditactivity');
    Route::get('delactivity', 'Backend\IndexController@delactivity');


    //留言管理
    Route::get('comment', 'Backend\CommentController@index');
    Route::get('delcomment', 'Backend\CommentController@destroy');
    Route::get('recomment', 'Backend\CommentController@recomment');
    Route::post('recomment', 'Backend\CommentController@dorecomment');

    Route::get('transfer', 'Backend\TransferController@index');
    Route::get('recharge', 'Backend\RechargeController@index');
    Route::get('order', 'Backend\OrderController@index');
    Route::any('doorder', 'Backend\OrderController@doorder');
    Route::get('users', 'Backend\UsersController@index');


    //修改密码
    Route::get('repassword', 'Backend\IndexController@repassword');
    Route::post('repassword', 'Backend\IndexController@postrepassword');


    //监控
    Route::get('monitor', 'Backend\IndexController@monitor');
});

Route::get('/wx/barpay', 'WebController@barPay');




/*Route::any('/show/login', 'WechatController@login');
Route::any('/show/index', 'WechatController@index');
Route::any('/show/authorize', 'WechatController@authorizes');*/
//Route::any('/wechat', 'WechatController@serve');